# print('hello word')

name = "adb lovelace"
# title 首字母大写
# print(name.title())
#
# name = "Adb Lovelace"
# print(name.upper())
# print(name.lower())

first_name = "adb"
last_name = "lovelace"
full_name = f"{first_name},{last_name}"
# full_name = "{},{}".format(first_name,last_name)

# print(full_name)
# print(f"Hello,{full_name.title()}!")
#
# print(1+2)
# print('\t\npython\n\tmm')

language = '       python                 '
# print(language)
language1 = language.rstrip()
print(language1)

print(100_000_99)

classmates = ['ttt', '陈广德', '陈佳奇', '仇颖', '冯嘉威']
# del classmates[-1]
# c= classmates.pop(0)
c = classmates.remove('冯嘉威')
print(f"My favorite is c")

a = ['ads', 'cba', 'bbc']
b = [1, 5, 3, 2, 6]
# d = a.sort(reverse=True)
# b.sort(reverse=True)0
# a.reverse()
# print(a)
# a.reverse()
# print(a)
# print(b)

# ss = len(a)
# print(ss)
for i in a:
    print(f"My favorite is {i.title()},good!")
    print(f"see you {i.title()}\n")
# print(sorted(a))
# print(a)

age = 22
if age < 18:  # 为True时则执行
    print('未成年')

rs = ['ads', 'cba', 'bbc']
if rs:
    for r in rs:
        print(f"you is {r.title()}")

else:
    print('is you!')

a1 = {'color': 'green', 'speed': 'slow', 'points': '5'}
# a2 = a1.get('point')
# print(a2)

for key in sorted(a1.keys()):  # 这里的key()可省略
    print(f"\nkey: {key}")
    # print(f"valeu: {value}")

a2 = {'color', 'speed', 'points'}

print(a2)

pizza = {
    'crust': 'thick',
    'toppings': ['mushrooms', 'extra cheese'],
}

print(f"you is {pizza['crust']} "
      "with you!")

for topping in pizza['toppings']:
    print('\t' + topping)

# favorite_languages = {
#     'jen': ['python','ruby'],
#     'sarah': 'c',
#     'edward': ['ruby','go'],
#     'phil': 'python'
# }
#
# for name,languages in favorite_languages.items():
#     if len(languages) == 1 or len(languages) == 6:
#         print(f"\n{name.title()} favorite language is {languages.title()}")
#     else:
#         print(f"\n{name.title()} favorite language is :")
#         for language in languages:
#             print(f"\t{language.title()}")


# users = {
#     'aeinstein': {
#         'first': 'albert',
#         'last': 'einstein',
#         'location': 'princeton',
#         },
#
#     'mcurie': {
#         'first': 'marie',
#         'last': 'curie',
#         'location': 'paris',
#         },
#
#     }
#
# for user,user_info in users.items():
#     print(f"\nusername: {user}")
#     f1 = f"{user_info['first']} {user_info['last']}"
#     f2 = f"{user_info['location']}"
#
#     print(f"\tfull_name: {f1}")
#     print(f"\tlacations: {f2}")
#
#
# age = int(input('How old are you? '))
# print(age)

# % 指出余数  %% 指出除数

# prompt = "\nTell me something, and I will repeat it back to you:"
# prompt += "\nEnter 'quit' to end the program. "
#
# active = True
# while active:
#     message = input(prompt)
#
#     if message == 'quit':
#         active = False
#     else:
#         print(message)


# prompt = '\nYou have visited:'
# prompt += '\nWhen you are finished: '
#
# while True:
#     city = input(prompt)
#
#     if city == 'quit':
#         break
#     else:
#         print(f"You is {city.title()}!")


# s = 0
# while s < 10:
#     s += 1
#     if s % 2 == 0:
#         continue
#     print(s)
#
#
# x = 1
# while x < 5:
#     print(x)
#     x = 1


# unconfirmed_users = ['alice','brian','candace']
# confirmed_users = []
#
# while unconfirmed_users:
#     current_user = unconfirmed_users.pop()
#
#     print(f"Verifying user: {current_user.title()}")
#     confirmed_users.append(current_user)
#
# print("\nThe is:")
# for confirmed_user in confirmed_users:
#     print(confirmed_user.title())


responses = {}
polling_active = True
while polling_active:
    # Prompt for the person's name and response.
    name = input("\nWhat is your name? ")
    response = input("Which mountain would you like to climb someday? ")

    # Store the response in the dictionary.
    responses[name] = response

    # Find out if anyone else is going to take the poll.
    repeat = input("Would you like to let another person respond? (yes/ no) ")
    if repeat == 'no':
        polling_active = False

# Polling is complete. Show the results.
print(responses)
print("\n--- Poll Results ---")
for name, response in responses.items():
    print(f"{name} would like to climb {response}.")


